//
//  YFColorDef.h
//  TechandForPartner
//
//  Created by Yutian Duan on 16/7/23.
//  Copyright © 2016年 techand. All rights reserved.
//

#ifndef YFColorDef_h
#define YFColorDef_h

// 根据RGB 色值
/**
 * Creates an opaque UIColor object from a byte-value color definition.
 */
#define RGBCOLOR(r,g,b) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:1]

/**
 * Creates a UIColor object from a byte-value color definition and alpha transparency.
 */
#define RGBACOLOR(r,g,b,a) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:(a)]


// 16进制 色值
#ifndef HEXCOLOR
#define HEXCOLOR(hex) RGBCOLOR(((hex >> 16) & 0xFF), ((hex >> 8) & 0xFF), ((hex) & 0xFF))

// Example:
// HEXCOLOR(0xFF00FF) for colors pasted from DigitalColor Meter (handy tool, use it!)

#endif

// `a` is a floating point value [0...1].
#ifndef HEXACOLOR
#define HEXACOLOR(hex,a) RGBACOLOR(((hex >> 16) & 0xFF), ((hex >> 8) & 0xFF), ((hex) & 0xFF), (a))

// Example:
// HEXACOLOR(0xFF00FF, 0.5) for colors pasted from DigitalColor Meter, but with alpha

#endif


///// 主色值
//#ifndef PRIMARY
//#define PRIMARY           0xd12c5b
//#endif

/// 主色值
#ifndef COLOR_PRIMARY
#define COLOR_PRIMARY       RGBCOLOR(87, 172, 35) // #57ac23
#endif

#ifndef BAR_TINT
#define BAR_TINT            RGBACOLOR(247, 247, 247, 1) // default: #f7f7f7
#endif

/// 分割线颜色
#ifndef COLOR_SEPARATOR
#define COLOR_SEPARATOR     RGBCOLOR(200, 199, 204) // #c8c7cc
#endif

// 主题绿
#ifndef DEF_GREEND
#define DEF_GREEND          RGBCOLOR(87, 172, 35) // #57ac23
#endif

/// 主题灰
#define THEME_GRAY          [UIColor lightGrayColor]

#define DEF_RED             HEXCOLOR(0xbb2d25)

///!  默认灰
#define DEF_GRAY            HEXCOLOR(0xbebebe)

///! 默认背景
#define DEF_BgColor         HEXCOLOR(0xf7f8fc)

// 默认黑色
#define DEF_BLACK           HEXCOLOR(0x333333)

/// 高亮橙色
#define Color_Highlight     RGBCOLOR(252, 173, 42)

/// 安全 绿色
#define Color_Safe          DEF_GREEND

/// 警告 红色
#define Color_Warnning      RGBCOLOR(240, 70, 73)

// 字号转化
#define GET_FONT(FONT)      (FONT/2)

// 默认字号
#define GET_DEFFONT         GET_FONT(30)

// 比例兑换
#define GET_RATE(FLOAG)     FLOAG/1334.00

// 得到数值
#define GET_LENGTH(FLOAG)   GET_RATE(FLOAG) * ScreenHeight

#endif /* YFColorDef_h */
